import os

# 项目根目录
PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__))
# 用例所在目录
TEST_CASE_DIR = "test_cases"
# 用例文件的名称
CASE_FILE_NAME = "cases.yaml"
# 公共字段 key
COMMON_FIELD_KEY = "common"

# 公共的变量、函数存在在此
OUTER_QUOTE_MODULE = "conf.quote"


REFLECT_VAR_EXP = r"\${(.+?)}"
REFLECT_FUNCTION_EXP = r"\${__(.+?)\((.*?)\)}"
INNER_QUOTE_EXP = r"%{(.+?)}"
CASE_QUOTE_EXP = r"@{(.+?):(.+?)}"

# allure 服务的host与port，allure报告所在的位置
ALLURE_HOST = "127.0.0.1"
ALLURE_PORT = "9999"
ALLURE_TMP_DIR = os.path.join(PROJECT_ROOT, "report", "allure_tmp")
ALLURE_REPORT_DIR = os.path.join(PROJECT_ROOT, "report")


# 日志格式
LOG_FMT = "%(levelname)-8s%(asctime)s %(name)s:%(filename)s:%(lineno)d %(message)s"
# LOG_FMT = ""
LOG_DIR = "logs"
INFO_LOG_PATH = os.path.join(PROJECT_ROOT, LOG_DIR, "info.log")
ERROR_LOG_PATH = os.path.join(PROJECT_ROOT, LOG_DIR, "error.log")
BACK_COUNT = 3
